<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="my" tagdir="/WEB-INF/tags/"%>
<c:set var="contextPath" value="${pageContext.servletContext.contextPath}"></c:set>
<script type="text/javascript">
	function check() {
		if (addform.password2.value != addform.password1.value) {
			alert("两次密码输入不一致");
			addform.password2.focus();
			return false;
		}
	}
</script>
<script language=javascript>
	function CharMode(iN) {
		if (iN >= 48 && iN <= 57) //数字
			return 1;
		if (iN >= 65 && iN <= 90) //大写
			return 2;
		if (iN >= 97 && iN <= 122) //小写
			return 4;
		else
			return 8;
	}
	function bitTotal(num) {
		modes = 0;
		for (i = 0; i < 4; i++) {
			if (num & 1)
				modes++;
			num >>>= 1;
		}
		return modes;
	}
	function checkStrong(sPW) {
		if (sPW.length <= 4)
			return 0;
		Modes = 0;
		for (i = 0; i < sPW.length; i++) {
			Modes |= CharMode(sPW.charCodeAt(i));
		}
		return bitTotal(Modes);
	}

	function pwStrength(pwd) {
		O_color = "#eeeeee";
		L_color = "#FF0000";
		M_color = "#FF9900";
		H_color = "#33CC00";
		if (pwd == null || pwd == '') {
			Lcolor = Mcolor = Hcolor = O_color;
		} else {
			S_level = checkStrong(pwd);
			switch (S_level) {
			case 0:
				Lcolor = Mcolor = Hcolor = O_color;
			case 1:
				Lcolor = L_color;
				Mcolor = Hcolor = O_color;
				break;
			case 2:
				Lcolor = Mcolor = M_color;
				Hcolor = O_color;
				break;
			default:
				Lcolor = Mcolor = Hcolor = H_color;
			}
		}
		document.getElementById("strength_L").style.background = Lcolor;
		document.getElementById("strength_M").style.background = Mcolor;
		document.getElementById("strength_H").style.background = Hcolor;
		return;
	}
</script>


	<div class="row">
		<div class="col-md-2">
			<img src="${contextPath}/img/icon1.gif" />图书列表
		</div>
	</div>
	<div class="row">
		<div class="col-md-12"
			style="background-image: url('./img/top01.gif'); background-repeat: repate-x; height: 25px">
		</div>
	</div>

	<c:forEach var="item" varStatus="status" items="${requestScope.titles}">
		<c:if test="${status.index % 4 == 0}">
			<div class="row">
		</c:if>
		<div class="col-md-3">
			<a href="./show.do?isbn=${item.isbn}" class="thumbnail"> <img
				src="${contextPath}/img/${item.imageFile}" />
				<p class="title_height">${item.title}</p>
			</a>
		</div>
		<c:if test="${status.index % 4 == 3 || status.last}">
</div>
		</c:if>
	</c:forEach>

<my:paging current="${currentPage}" total="${total}"></my:paging>
